package com.zbkj.common.model.monitor;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.model.brand.Brand;
import com.zbkj.common.model.merchant.Merchant;
import com.zbkj.common.monitorchannel.vo.MonitorChannelEquipmentStatusVo;
import com.zbkj.common.monitorchannel.vo.MonitorChannelMediaAddressVo;
import com.zbkj.common.response.ProMerchantProductResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName: ZfbMonitorEquipment
 * @Description: TODO
 * @Author: fanbing
 * @Date: 2024/6/29 12:51
 * @Version: V1.0
 **/

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("zfb_monitor_equipment")
public class ZfbMonitorEquipment {

    @ApiModelProperty(value = "设备ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    @ApiModelProperty("商户id")
    private Integer merchantId;


    @ApiModelProperty("设备名称")
    private String equipmentName;


    @ApiModelProperty("设备类型 0:鹤梦云 ")
    private Integer equipmentType;

    @ApiModelProperty("设备license")
    private String license;


    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @LastModifiedDate
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间", hidden = true)
    private LocalDateTime updateTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("设备状态(0:未知; 1: 在线; 2:离线; 3:休眠; 6:设备区域限制; 7:4G 卡限制)")
    @TableField("online_status")
    private Integer onlineStatus;

    @TableField(exist = false)
    private MonitorChannelEquipmentStatusVo channelEquipmentStatusVo;
    // 设备地址
    @TableField(exist = false)
    private List<MonitorChannelMediaAddressVo> monitorMediaAddressList;
    // 产品列表
    @TableField(exist = false)
    private List<ProMerchantProductResponse> proList;
    // 商户
    @ApiModelProperty("商户信息")
    @TableField(exist = false)
    private Merchant merchantInfo;

    @ApiModelProperty("品牌商信息")
    @TableField(exist = false)
    private Brand brand;

    @ApiModelProperty("商户店铺二维码")
    @TableField(exist = false)
    private String qrCode;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "最新在线时间", hidden = true)
    private LocalDateTime lastOnlineTime;

}
